$(document).ready(function() {
	var passwordLi = $(".decrypt_box .password li");
	var numberDd = $(".decrypt_pop .number dd");
	var delBtn = $(".decrypt_pop .number dt.del");
	var currentNum = 0;
	var pass = "";
	
	// 键盘输入密码
	numberDd.on("click", function() {
		if(currentNum < 4) {
			var val = $(this).text();
			pass += val;
			passwordLi.eq(currentNum).text(val); // 填入密码值
			currentNum++;
			if(currentNum == 4) {
				//执行判断操作
				validPassword(pass,function(){
					passwordLi.text("");
					currentNum = 0;
					pass="";
				});
			}
		}
	})
	
	// 删除按钮
	delBtn.on("click", function() {
		if(currentNum > 0) {
			currentNum--;
			passwordLi.eq(currentNum).text("");
			pass = pass.substring(0, pass.length-1);
		}
	})
})